package com.markerhub.mapper;

import com.markerhub.entity.TeachingCallingDetail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;


@Mapper
public interface TeachingCallingDetailMapper extends BaseMapper<TeachingCallingDetail> {
    @Select("SELECT tcd.*, ms.stu_name as studentName " +
            "FROM m_teaching_calling_detail tcd " +
            "INNER JOIN m_teaching_student_in_class tsic ON tcd.stu_in_class_id = tsic.id " +
            "INNER JOIN m_manager_student ms ON tsic.student_id = ms.id " +
            "WHERE tcd.call_id = #{callId}")
    List<TeachingCallingDetail> getCallingDetails(Integer callId);

    @Select("SELECT * FROM m_teaching_calling_detail " +
            "WHERE call_id = #{callId} AND stu_in_class_id = #{stuInClassId}")
    TeachingCallingDetail getStudentCallingDetail(Integer callId, Integer stuInClassId);


}
